import { SubjectComponent } from "./subject";

const { ccclass, property } = cc._decorator;

@ccclass
export default class GameTask extends SubjectComponent {
    @property
    isSync = false;
    @property
    isBeforeGame = true;

    isDone = false;
    async init() {
        await this.onInit();
        this.finish();
    }
    async onInit() { }

    finish() {
        this.isDone = true;
        this.emit("finished", this);
        this.onFinished();
    }
    onFinished() {  }
};